//
//  SXTLandingViewController.m
//  SXT
//
//  Created by 赵金鹏 on 16/8/11.
//  Copyright © 2016年 赵金鹏. All rights reserved.
//

#import "SXTLandingViewController.h"
#import "SXTLandingInPutView.h"//输入账号密码的view
#import "SXTThirdLandingView.h"//第三方登录按钮的view
#import "SXTLandingNextViewController.h"//下一步viewController

@interface SXTLandingViewController ()

@property (strong, nonatomic)   SXTLandingInPutView *landingInPutView;              /** 输入框view */
@property (strong, nonatomic)   SXTThirdLandingView *thirdView;              /** 第三方登录view */

@end

@implementation SXTLandingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    self.title = @"注册";
    [self addAutoLayout];
    
}

- (void)addAutoLayout{
    [self.view addSubview:self.landingInPutView];
    [self.view addSubview:self.thirdView];
    
    __weak typeof (self) weakSelf = self;
    [_landingInPutView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(weakSelf.view);
        make.height.equalTo(@210);
    }];
    
    [_thirdView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(weakSelf.landingInPutView);
        make.top.equalTo(weakSelf.landingInPutView.mas_bottom);
        make.height.equalTo(@80);
    }];
    
}

- (SXTLandingInPutView *)landingInPutView{
    if (!_landingInPutView) {
        _landingInPutView = [[SXTLandingInPutView alloc]init];
        __weak typeof (self) weakSelf = self;
        _landingInPutView.newxtBlock = ^(NSDictionary *userDic){
            SXTLog(@"userDic:%@",userDic);
            SXTLandingNextViewController *nextViewController = [[SXTLandingNextViewController alloc]init];
            nextViewController.userDic = userDic;
            [weakSelf.navigationController pushViewController:nextViewController animated:YES];
        };
    }
    return _landingInPutView;
}

- (SXTThirdLandingView *)thirdView{
    if (!_thirdView) {
        _thirdView = [[SXTThirdLandingView alloc]init];
    }
    return _thirdView;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
